//
//  DKAuthNextCell.m
//  DanKU
//
//  Created by 吴斌 on 2023/11/22.
//

#import "DKAuthNextCell.h"

static NSString * DKAuthNextCellId = @"DKAuthNextCellId";
@implementation DKAuthNextCell
+ (instancetype)authNextCell:(UITableView *)tableView{
    DKAuthNextCell * dk_AuthNextCell = [tableView dequeueReusableCellWithIdentifier:DKAuthNextCellId];
    if (!dk_AuthNextCell) {
        dk_AuthNextCell = [[DKAuthNextCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:DKAuthNextCellId];
    }
    dk_AuthNextCell.backgroundColor = [UIColor clearColor];
    dk_AuthNextCell.selectionStyle = UITableViewCellSelectionStyleNone;
    dk_AuthNextCell.accessoryType = UITableViewCellAccessoryNone;
    return dk_AuthNextCell;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self dk_addSubView];
    }
    return self;
}
- (void)dk_addSubView{
    UIButton * dk_AuthFaceCertificationBtn = [[UIButton alloc] init];
    [dk_AuthFaceCertificationBtn setTitle:@"Next" forState:UIControlStateNormal];
    [dk_AuthFaceCertificationBtn setTitleColor:DK_Hex(@"#4566FF") forState:UIControlStateDisabled];
    [dk_AuthFaceCertificationBtn setTitleColor:DK_Hex(@"#FFFFFF") forState:UIControlStateNormal];
    dk_AuthFaceCertificationBtn.titleLabel.font = DK_FONT_Semibold(16);
    [dk_AuthFaceCertificationBtn setBackgroundImage:DK_GetImage(@"dk_registerNextSelectBg") forState:UIControlStateNormal];
    [dk_AuthFaceCertificationBtn addTarget:self action:@selector(authFaceCertification) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:dk_AuthFaceCertificationBtn];
    [dk_AuthFaceCertificationBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(DK_IsWidthScale(30)));
        make.right.equalTo(@(-DK_IsWidthScale(30)));
        make.top.equalTo(@(DK_IsWidthScale(0)));
        make.bottom.equalTo(@(-DK_IsWidthScale(0)));
    }];
}
- (void)authFaceCertification{
    if(self.NextBlock){
        self.NextBlock();
    }
}

@end
